﻿Imports QLPhuTungOto.Data
Public Class PhieuNhapBUS
    Public Sub ThemPhieuNhap(ByVal lst_ChiTietPhieuNhap As List(Of ChiTietPhieuNhap), ByVal ghiChuPhieuNhap As String)
        Dim db As New QLPhuTungOtoDataContext
        db.PhieuNhap.ThemPhieuNhap(lst_ChiTietPhieuNhap, ghiChuPhieuNhap)
    End Sub

    Public Function LayDSPhieuNhap() As List(Of PhieuNhap)
        Dim db As New QLPhuTungOtoDataContext
        Return db.PhieuNhap.LayDSPhieuNhap()
    End Function

    Public Sub XoaPhieuNhap(ByVal maPN As Integer)
        Dim db As New QLPhuTungOtoDataContext
        db.PhieuNhap.Delete(maPN)
    End Sub

    Public Function LayDSPNTheoThoiGian(ByVal _from As Date, ByVal _to As Date) As List(Of PhieuNhap)
        Dim db As New QLPhuTungOtoDataContext
        Return db.PhieuNhap.LayDSPNTheoThoiGian(_from, _to)
    End Function

    Public Function LayDSPNTheoThoiGian(ByVal _from As Date, ByVal _to As Date, ByVal _dongbatdau As Integer, ByVal _sl As Integer) As List(Of PhieuNhap)
        Dim db As New QLPhuTungOtoDataContext
        Return db.PhieuNhap.LayDSPNTheoThoiGian(_from, _to, _dongbatdau, _sl)
    End Function

    Public Function DemPNTheoThoiGian(ByVal _from As Date, ByVal _to As Date) As Integer
        Dim db As New QLPhuTungOtoDataContext
        Return db.PhieuNhap.DemPNTheoThoiGian(_from, _to)
    End Function
End Class